package com.example.basicdemo.model.builder;

import com.isyscore.os.dev.api.IsyscoreRequestBuilder;
import com.isyscore.os.dev.util.IsyscoreHashMap;
import com.isyscore.os.dev.util.RequestUtils;
import com.isyscore.os.dev.util.StringUtils;

import javax.servlet.http.HttpServletRequest;

public class ResetPasswordRequestBuilder extends IsyscoreRequestBuilder {

    private IsyscoreHashMap headers;

    private String phoneNumber;

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public ResetPasswordRequestBuilder setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
        return this;
    }

    public IsyscoreHashMap getHeaders() {
        return headers;
    }

    public ResetPasswordRequestBuilder setHeaders(IsyscoreHashMap headers) {
        this.headers = headers;
        return this;
    }

    @Override
    public boolean validate() {
        if (StringUtils.isEmpty(phoneNumber)) {
            throw new NullPointerException("phoneNumber should not be NULL or EMPTY!");
        }
        return true;
    }

    @Override
    public IsyscoreRequestBuilder setRequestHeader(HttpServletRequest request) {
        this.headers = RequestUtils.getRequestHeader(request);
        return this;
    }



}
